package com.weiaibenpao.demo.chislim.presenter;

import com.weiaibenpao.demo.chislim.base.BasePresenter;
import com.weiaibenpao.demo.chislim.bean.TravelBean;
import com.weiaibenpao.demo.chislim.retrofit.RetrofitUtils;
import com.weiaibenpao.demo.chislim.retrofit.rx.NetWorkTransformer;
import com.weiaibenpao.demo.chislim.retrofit.rx.SimpleObserver;
import com.weiaibenpao.demo.chislim.view.DjqTravelView;

/**
 * Created by wlx on 2017/12/13.
 */

public class DjqTravelPresenter extends BasePresenter<DjqTravelView> {
    public void getDjqTravel(int page,int size){
        RetrofitUtils.getAPIService().getDjqTravel(page,size).
                compose(new NetWorkTransformer<TravelBean>()).
                subscribe(new SimpleObserver<TravelBean>(mCompositeDisposable) {
                    @Override
                    public void call(TravelBean travelBean) {
                        getView().djqTravelSuccess(travelBean);
                    }

                });
    }
}
